using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class ICPurchaseMap : EntityTypeConfiguration<ICPurchase>
    {
        public ICPurchaseMap()
        {
            // Primary Key
            this.HasKey(t => t.FInterID);

            // Properties
            this.Property(t => t.FBrNo)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FInterID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FNote)
                .HasMaxLength(255);

            this.Property(t => t.FBillerName)
                .HasMaxLength(50);

            this.Property(t => t.FRSCBillNo)
                .HasMaxLength(30);

            this.Property(t => t.FCompactNo)
                .HasMaxLength(255);

            this.Property(t => t.FYearPeriod)
                .HasMaxLength(25);

            this.Property(t => t.FFreeItem1)
                .HasMaxLength(20);

            this.Property(t => t.FFreeItem2)
                .HasMaxLength(20);

            this.Property(t => t.FFreeItem3)
                .HasMaxLength(20);

            this.Property(t => t.FFreeItem4)
                .HasMaxLength(20);

            this.Property(t => t.FAddress)
                .HasMaxLength(255);

            this.Property(t => t.FTaxNum)
                .HasMaxLength(255);

            this.Property(t => t.FAccount)
                .HasMaxLength(255);

            this.Property(t => t.FBank)
                .HasMaxLength(255);

            this.Property(t => t.FExplanation)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FPOOrdBillNo)
                .HasMaxLength(255);

            this.Property(t => t.FOperDate)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(8)
                .IsRowVersion();

            // Table & Column Mappings
            this.ToTable("ICPurchase");
            this.Property(t => t.FBrNo).HasColumnName("FBrNo");
            this.Property(t => t.FInterID).HasColumnName("FInterID");
            this.Property(t => t.FBillNo).HasColumnName("FBillNo");
            this.Property(t => t.FTranType).HasColumnName("FTranType");
            this.Property(t => t.FDate).HasColumnName("FDate");
            this.Property(t => t.FVoucherID).HasColumnName("FVoucherID");
            this.Property(t => t.FNote).HasColumnName("FNote");
            this.Property(t => t.FCurrencyID).HasColumnName("FCurrencyID");
            this.Property(t => t.FDeptID).HasColumnName("FDeptID");
            this.Property(t => t.FEmpID).HasColumnName("FEmpID");
            this.Property(t => t.FHookInterID).HasColumnName("FHookInterID");
            this.Property(t => t.FVchInterID).HasColumnName("FVchInterID");
            this.Property(t => t.FBillerName).HasColumnName("FBillerName");
            this.Property(t => t.FCheckerID).HasColumnName("FCheckerID");
            this.Property(t => t.FPosterID).HasColumnName("FPosterID");
            this.Property(t => t.FManagerID).HasColumnName("FManagerID");
            this.Property(t => t.FPosted).HasColumnName("FPosted");
            this.Property(t => t.FSupplyID).HasColumnName("FSupplyID");
            this.Property(t => t.FClosed).HasColumnName("FClosed");
            this.Property(t => t.FROB).HasColumnName("FROB");
            this.Property(t => t.FRSCBillNo).HasColumnName("FRSCBillNo");
            this.Property(t => t.FExchangeRate).HasColumnName("FExchangeRate");
            this.Property(t => t.FStatus).HasColumnName("FStatus");
            this.Property(t => t.FCompactNo).HasColumnName("FCompactNo");
            this.Property(t => t.FCancellation).HasColumnName("FCancellation");
            this.Property(t => t.FBillerID).HasColumnName("FBillerID");
            this.Property(t => t.FPOStyle).HasColumnName("FPOStyle");
            this.Property(t => t.FYearPeriod).HasColumnName("FYearPeriod");
            this.Property(t => t.FMultiCheckLevel1).HasColumnName("FMultiCheckLevel1");
            this.Property(t => t.FMultiCheckLevel2).HasColumnName("FMultiCheckLevel2");
            this.Property(t => t.FMultiCheckLevel3).HasColumnName("FMultiCheckLevel3");
            this.Property(t => t.FMultiCheckLevel4).HasColumnName("FMultiCheckLevel4");
            this.Property(t => t.FMultiCheckLevel5).HasColumnName("FMultiCheckLevel5");
            this.Property(t => t.FMultiCheckLevel6).HasColumnName("FMultiCheckLevel6");
            this.Property(t => t.FMultiCheckDate1).HasColumnName("FMultiCheckDate1");
            this.Property(t => t.FMultiCheckDate2).HasColumnName("FMultiCheckDate2");
            this.Property(t => t.FMultiCheckDate3).HasColumnName("FMultiCheckDate3");
            this.Property(t => t.FMultiCheckDate4).HasColumnName("FMultiCheckDate4");
            this.Property(t => t.FMultiCheckDate5).HasColumnName("FMultiCheckDate5");
            this.Property(t => t.FMultiCheckDate6).HasColumnName("FMultiCheckDate6");
            this.Property(t => t.FCurCheckLevel).HasColumnName("FCurCheckLevel");
            this.Property(t => t.FYtdIntRate).HasColumnName("FYtdIntRate");
            this.Property(t => t.FAcctID).HasColumnName("FAcctID");
            this.Property(t => t.FOrgBillInterID).HasColumnName("FOrgBillInterID");
            this.Property(t => t.FFincDate).HasColumnName("FFincDate");
            this.Property(t => t.FArApStatus).HasColumnName("FArApStatus");
            this.Property(t => t.FYear).HasColumnName("FYear");
            this.Property(t => t.FPeriod).HasColumnName("FPeriod");
            this.Property(t => t.FTotalExpense).HasColumnName("FTotalExpense");
            this.Property(t => t.FTotalExpenseFor).HasColumnName("FTotalExpenseFor");
            this.Property(t => t.FOffsetTax).HasColumnName("FOffsetTax");
            this.Property(t => t.FOffsetTaxFor).HasColumnName("FOffsetTaxFor");
            this.Property(t => t.FTotalCost).HasColumnName("FTotalCost");
            this.Property(t => t.FTotalCostFor).HasColumnName("FTotalCostFor");
            this.Property(t => t.FSubSystemID).HasColumnName("FSubSystemID");
            this.Property(t => t.FInvStyle).HasColumnName("FInvStyle");
            this.Property(t => t.FHookerID).HasColumnName("FHookerID");
            this.Property(t => t.FOuterID).HasColumnName("FOuterID");
            this.Property(t => t.FClassTypeID).HasColumnName("FClassTypeID");
            this.Property(t => t.fitemclassid).HasColumnName("fitemclassid");
            this.Property(t => t.FCOMINVID).HasColumnName("FCOMINVID");
            this.Property(t => t.FTaskID).HasColumnName("FTaskID");
            this.Property(t => t.FOrderID).HasColumnName("FOrderID");
            this.Property(t => t.FResourceID).HasColumnName("FResourceID");
            this.Property(t => t.FBudgetAmountFor).HasColumnName("FBudgetAmountFor");
            this.Property(t => t.FOrderAmountFor).HasColumnName("FOrderAmountFor");
            this.Property(t => t.FFreeItem1).HasColumnName("FFreeItem1");
            this.Property(t => t.FFreeItem2).HasColumnName("FFreeItem2");
            this.Property(t => t.FFreeItem3).HasColumnName("FFreeItem3");
            this.Property(t => t.FFreeItem4).HasColumnName("FFreeItem4");
            this.Property(t => t.FAddress).HasColumnName("FAddress");
            this.Property(t => t.FTaxNum).HasColumnName("FTaxNum");
            this.Property(t => t.FAccount).HasColumnName("FAccount");
            this.Property(t => t.FBank).HasColumnName("FBank");
            this.Property(t => t.FCheckDate).HasColumnName("FCheckDate");
            this.Property(t => t.FExplanation).HasColumnName("FExplanation");
            this.Property(t => t.FPayStyle).HasColumnName("FPayStyle");
            this.Property(t => t.FAdjustExchangeRate).HasColumnName("FAdjustExchangeRate");
            this.Property(t => t.FAdjustAmount).HasColumnName("FAdjustAmount");
            this.Property(t => t.FSelTranType).HasColumnName("FSelTranType");
            this.Property(t => t.FChildren).HasColumnName("FChildren");
            this.Property(t => t.FHookStatus).HasColumnName("FHookStatus");
            this.Property(t => t.FActPriceVchTplID).HasColumnName("FActPriceVchTplID");
            this.Property(t => t.FPlanPriceVchTplID).HasColumnName("FPlanPriceVchTplID");
            this.Property(t => t.FActualVchTplID).HasColumnName("FActualVchTplID");
            this.Property(t => t.FPlanVchTplID).HasColumnName("FPlanVchTplID");
            this.Property(t => t.FBrID).HasColumnName("FBrID");
            this.Property(t => t.FTranStatus).HasColumnName("FTranStatus");
            this.Property(t => t.FCussentAcctID).HasColumnName("FCussentAcctID");
            this.Property(t => t.FCheckStatus).HasColumnName("FCheckStatus");
            this.Property(t => t.fconnectflag).HasColumnName("fconnectflag");
            this.Property(t => t.FCheckAmount).HasColumnName("FCheckAmount");
            this.Property(t => t.FCheckAmountFor).HasColumnName("FCheckAmountFor");
            this.Property(t => t.FRemainAmount).HasColumnName("FRemainAmount");
            this.Property(t => t.FRemainAmountFor).HasColumnName("FRemainAmountFor");
            this.Property(t => t.FDC).HasColumnName("FDC");
            this.Property(t => t.FGUID).HasColumnName("FGUID");
            this.Property(t => t.FPOOrdBillNo).HasColumnName("FPOOrdBillNo");
            this.Property(t => t.FRelateBrID).HasColumnName("FRelateBrID");
            this.Property(t => t.FSettleDate).HasColumnName("FSettleDate");
            this.Property(t => t.FManageType).HasColumnName("FManageType");
            this.Property(t => t.FOperDate).HasColumnName("FOperDate");
            this.Property(t => t.FSysStatus).HasColumnName("FSysStatus");
        }
    }
}
